#include <iostream>
#include <memory>
#include <unistd.h>
#include "Thread.hpp"
using namespace std;
void *thread_run(void *args)
{
    string work_type = static_cast<const char *>(args);
    int cnt = 10;
    while (cnt--)
    {
        cout << "新线程" << work_type << " " << cnt << endl;
        sleep(1);
    }
}
int main()
{
    unique_ptr<Thread> thread1(new Thread(thread_run, (void *)"thred1", 1));
    unique_ptr<Thread> thread2(new Thread(thread_run, (void *)"thred2", 2));
    unique_ptr<Thread> thread3(new Thread(thread_run, (void *)"thred3", 3));

    thread1->join();
    thread2->join();
    thread3->join();
    return 0;
}